import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Test {
    public static List<Character> function(String str1,String str2){
        List<Character> list = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++){
            char ch = str1.charAt(i);
            if (!str2.contains(ch+"")){
                list.add(ch);
            }
        }
        return list;
    }

    public static void main(String[] args) {
        List<Character> list = function("hello word", "eo");
        Iterator<Character> it = list.iterator();
        while(it.hasNext()){
            System.out.print(it.next());
        }
        System.out.println();
    }
}
